﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BookStore
{
    internal class sqlConnection
    {
        private  string _connectionstring = "Data Source=DESKTOP-NVCT8CP;Integrated Security=True;Connect Timeout=30;Encrypt=False;";
        private SqlConnection _connection;
        public string GetConnectionString()
        {
            return _connectionstring;
        }

        public void SetConnectionString(string connectionstring)
        {
            _connectionstring = connectionstring;
            return;
        }
        public SqlConnection CreateSqlConnection()
        {
            this._connection = new SqlConnection(_connectionstring);
            return _connection;
        }

        public void Dispose() 
        {
            this._connection.Dispose();
        }

    }
}
